package com.yanqu.road.entity.activity.washe.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_n_washe_scene")
public class WasheSceneData extends DataObject {

    @FieldTypeAnnotation(desc = "渠道key", select = true, update = true)
    private String channelKey;

    @FieldTypeAnnotation(desc = "剧目ID")
    private List<Integer> sceneList;

    @FieldTypeAnnotation(desc = "重置时间")
    private long refreshTime;

    @FieldTypeAnnotation(desc = "概率累计")
    private ConcurrentHashMap<Integer, Integer> sceneWeightMap = new ConcurrentHashMap<>();


    public String getChannelKey() {
        return channelKey;
    }

    public void setChannelKey(String channelKey) {
        if (channelKey == null) {
            return;
        }
        if (this.channelKey == null || !this.channelKey.equals(channelKey)) {
            this.channelKey = channelKey;
            setOp(DataStatus.Update);
        }
    }

    public List<Integer> getSceneList() {
        return sceneList;
    }

    public void setSceneList(List<Integer> sceneList) {
        if (null == sceneList) {
            return;
        }
        if (this.sceneList == null || !this.sceneList.equals(sceneList)) {
            this.sceneList = sceneList;
            setOp(DataStatus.Update);
        }
    }

    public long getRefreshTime() {
        return refreshTime;
    }

    public void setRefreshTime(long refreshTime) {
        if (this.refreshTime != refreshTime) {
            this.refreshTime = refreshTime;
            setOp(DataStatus.Update);
        }
    }

    public ConcurrentHashMap<Integer, Integer> getSceneWeightMap() {
        return sceneWeightMap;
    }

    public void setSceneWeightMap(ConcurrentHashMap<Integer, Integer> sceneWeightMap) {
        if (sceneWeightMap != null) {
            this.sceneWeightMap = sceneWeightMap;
            setUpdateOption();
        }
    }

}
